package com.ysyx.ysyx_admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 管理员日志表
 * @TableName adminlog_inf
 */
@TableName(value ="adminlog_inf")
@Data
public class AdminlogPojo implements Serializable {
    /**
     * 日志id
     */
    @TableId(value = "log_id", type = IdType.AUTO)
    private Integer logId;

    /**
     * 管理员id
     */
    @TableField(value = "admin_id")
    private Integer adminId;

    /**
     * 日志内容
     */
    @TableField(value = "log_message")
    private String logMessage;

    /**
     * 日志创建时间
     */
    @TableField(value = "log_ctime")
    private Date logCtime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AdminlogPojo other = (AdminlogPojo) that;
        return (this.getLogId() == null ? other.getLogId() == null : this.getLogId().equals(other.getLogId()))
            && (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()))
            && (this.getLogMessage() == null ? other.getLogMessage() == null : this.getLogMessage().equals(other.getLogMessage()))
            && (this.getLogCtime() == null ? other.getLogCtime() == null : this.getLogCtime().equals(other.getLogCtime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLogId() == null) ? 0 : getLogId().hashCode());
        result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
        result = prime * result + ((getLogMessage() == null) ? 0 : getLogMessage().hashCode());
        result = prime * result + ((getLogCtime() == null) ? 0 : getLogCtime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", logId=").append(logId);
        sb.append(", adminId=").append(adminId);
        sb.append(", logMessage=").append(logMessage);
        sb.append(", logCtime=").append(logCtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}